#ifndef __DAY04_H_
#define __DAY04_H_
#include <iostream>
#include <cstring>
using namespace std;
#define ARGS_CHECK(argc, num)               \
    {                                       \
        if (argc != num)                    \
        {                                   \
            fprintf(stderr, args error !n); \
            return -1;                      \
        }                                   \
    }
#define ERROR_CHECK(ret, num, msg) \
    {                              \
        if (ret == num)            \
        {                          \
            perror(msg);           \
            exit(1);               \
        }                          \
    }
class op
{
    friend int operator-(op &lhs, op &rhs);
    friend int operator>(op &lhs, op &rhs);
    friend int operator==(op &lhs, op &rhs);
    friend ostream &operator<<(ostream &out, op &rhs);
   
public:
    op(int val);
    ~op();

public:
    op operator+(op &rhs);
    op operator++(int x);
    int getval();

private:
    int val;
};

int operator-(op &lhs, op &rhs);
int operator>(op &lhs, op &rhs);
int operator==(op &lhs, op &rhs);
ostream &operator<<(ostream &out, op &rhs);


class myString
{
    friend ostream &operator<<(ostream &out, myString &rhs);
    friend istream &operator>>(istream &in, myString &rhs);

public:
    myString(const char *p_new);
    myString(const myString &str);
    ~myString();

public:
    myString &operator+(myString rhs);
    int operator==(myString rhs);
    char operator[](int offset);
private:
    char *p;
    int len;
};
ostream &operator<<(ostream &out, myString &rhs);
istream &operator>>(istream &in, myString &rhs);

#endif
